print("============== 内网穿透客户端配置 ==============\n")
sAddr = input("服务器ip地址:")
sport = input("服务器端口:")
token = input("密码[token]:")
txt = f'serverAddr = "{sAddr}"\n'
txt += f'serverPort = {sport}\n'
txt += f'auth.token = "{token}"\n\n'
isend = True
while isend:
    name = input("名字<不可重复>:")
    type = input("转发类型[tcp,stcp,udp,sudp,xtcp]:")
    loip = input("要转发的ip地址:")
    loport = input("要转发的端口:")
    report = input("转发后的端口:")
    
    txt += f'[[proxies]]\n'
    txt += f'name = "{name}"\n'
    txt += f'type = "{type}"\n'
    txt += f'localIP = "{loip}"\n'
    txt += f'localPort = {loport}\n'
    txt += f'remotePort = {report}\n\n'
    
    ttt = "%s"%input("是否录取其他转发[y,n,回车结束]:")
    if ttt != "y":
        isend = False
    print(f'{name}[{loip}][{loport}] => [{report}] success...')

file = open("frpc.toml", "w")
file.write(txt)
file.close()
